<%@ page contentType="text/html; charset=utf-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!-- Content Slider -->
<div id="slider" class="box">
	<div id="slider-holder">
		<ul>
			<li><a href="#"><img src="images/slide1.jpg" alt="" /></a></li>
			<li><a href="#"><img src="images/slide1.jpg" alt="" /></a></li>
		</ul>
	</div>
	<div id="slider-nav">
		<a href="#" class="active">1</a> <a href="#">2</a>
	</div>
</div>
<!-- End Content Slider -->

<!-- Products -->
<div class="products box" id="list-mostsold">
	<h2
		style="font-size: 21px; text-align: center; height: 40px; line-height: 40px;">
		<spring:message code="top.mostsold" />
	</h2>
	<div class="box-content">
		<div class="cl">&nbsp;</div>
		<ul>
			<c:forEach var="mostSoldProduct" items="${mostSoldProducts.result}">
				<li><a
					href="<c:url value="/product?id=${mostSoldProduct.id}"/>"><img
						class="product-image" src="${mostSoldProduct.imagePath}" alt="" /></a>
					<div class="product-info">
						<h3>${mostSoldProduct.name}</h3>
						<div class="product-desc">
							<h4>${mostSoldProduct.type.name}</h4>
							<h4>
								<spring:message code="madein" />
								: ${mostSoldProduct.madeIn}
							</h4>
							<h4>
								<spring:message code="producer" />
								: ${mostSoldProduct.producer.name}
							</h4>
							<h5>
								<spring:message code="viewed" />
								: ${mostSoldProduct.views}
							</h5>
							<strong class="price"> <fmt:formatNumber type="number"
									value="${mostSoldProduct.price}" groupingUsed="true" /> VNĐ
							</strong>
						</div>
					</div></li>
			</c:forEach>
		</ul>
		<div class="cl">&nbsp;</div>
	</div>
</div>

<div class="products box" id="list-newest">
	<h2
		style="font-size: 21px; text-align: center; height: 40px; line-height: 40px;">
		<spring:message code="top.newest" />
	</h2>
	<div class="box-content">
		<div class="cl">&nbsp;</div>
		<ul>
			<c:forEach var="newestProduct" items="${newestProducts.result}">
				<li><a href="<c:url value="/product?id=${newestProduct.id}"/>"><img
						class="product-image" src="${newestProduct.imagePath}" alt="" /></a>
					<div class="product-info">
						<h3>${newestProduct.name}</h3>
						<div class="product-desc">
							<h4>${newestProduct.type.name}</h4>
							<h4>
								<spring:message code="madein" />
								: ${newestProduct.madeIn}
							</h4>
							<h4>
								<spring:message code="producer" />
								: ${newestProduct.producer.name}
							</h4>
							<h5>
								<spring:message code="viewed" />
								: ${newestProduct.views}
							</h5>
							<strong class="price"> <fmt:formatNumber type="number"
									value="${newestProduct.price}" groupingUsed="true" /> VNĐ
							</strong>
						</div>
					</div></li>
			</c:forEach>
		</ul>
		<div class="cl">&nbsp;</div>
	</div>
</div>
<!-- End Products -->